<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>checkl.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
     <script language="javascript">
		var test = new Array();
		test[0] = '0101';
		test[1] = '0103';
		test[2] = '0104';
		test[3] = '0106';
		
		// values is instranceof Array
		function check(values) {
			for(var c=0; c<values.length; c++) {
				isequals(values[c] + '');
			}
		} // end check()
		
		function isequals(v) {
			var chboxies = document.getElementById('sum').getElementsByTagName('INPUT');
			if(chboxies.length) {
				for(var c=0; c<chboxies.length; c++) {
					if(chboxies[c].name == 'fabu' && v == chboxies[c].value) {
						chboxies[c].checked = 'checked';
					}
				}
			}
		} // end isequals()
	
	</script>

	<form id='sum' name="sum">
	<INPUT type="checkbox" id="fabu" name="fabu" value="0101" >查看
	<INPUT type="checkbox" id="fabu" name="fabu" value="0102" >增加
	<INPUT type="checkbox" id="fabu" name="fabu" value="0103" >修改
	<INPUT type="checkbox" id="fabu" name="fabu" value="0104" >审核
	<INPUT type="checkbox" id="fabu" name="fabu" value="0105" >发布
	<INPUT type="checkbox" id="fabu" name="fabu" value="0106" >撤销发布
	<INPUT type="checkbox" id="fabu" name="fabu" value="0107" >删除
	<INPUT type="text" id="dd" name="tt" value="">
	</form>
	
	<a href="#" onclick="check(test);">bbb</a>
	
	<script language="javascript">
		check(test);
	</script> 
  </body>
</html>
